<a href="/user_station/station_calendar">Back</a>
<br/>
<h3>รอบ > <%=@station.name%> > <%="#{@book_date.day}/#{@book_date.month}/#{@book_date.year}"%></h3>
<table width="100%" class="index">
  <tr align="center">
    <th>Slot</th>
    <th>เวลา</th>
    <th>สถานะ</th>
    <th>ผู้จอง</th>
    <th></th>
  </tr>
  <%@slots.each_with_index do |s,i|%>
  <tr align="center">
    <td><%=i+1%></td>
    <td><%=s.start_time.strftime("%H:%M")%>-<%=s.end_time.strftime("%H:%M")%></td>
    <td><%=s.s_status%></td>
    <td><%if s.user_id%><%u=User.find(s.user_id)%><%if u%><%=u.full_name%><%end%><%end%></td>
    <td>
      <%if s.user_id==nil%><a href="/user_station/book_slot/<%=s.gencode%>">จอง</a><%end%>
      <%if s.user_id==session[:user_id]%>
        <a href="/user_station/cancel_slot/<%=s.gencode%>">ยกเลิก</a> |
        <a href="/user_station/print_book/<%=s.gencode%>" target="_blank">ใบนำสอบ</a>
      <%end%>
    </td>
  </tr>
  <%end%>
</table>